package com.example.springframeworklearning.service.impl;

import com.example.springframeworklearning.aspect.annotation.RefreshCache;
import com.example.springframeworklearning.domain.Order;
import com.example.springframeworklearning.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;

/**
 * @author luo
 * @since 2022/9/22 10:43
 */
@Slf4j
@Service
public class OrderServiceImpl implements OrderService {
    @Override
    public List<Order> listOrder() {
        Order result = new Order();
        result.setName("我是数据库中的订单");
        return Collections.singletonList(result);
    }

    @Override
    public Order createOrder(String name, LocalDateTime createTime) {
        Order order = new Order();
        order.setCreateTime(createTime);
        order.setName(name);
        notInvokeAdvice();
        return order;
    }

    public void notInvokeAdvice(){

    }

    @Override
    public Order deleteOrder(Long id) {
        return null;
    }

    @RefreshCache(policy = "strict")
    @Override
    public List<Order> page(int current, int size) {
        return null;
    }

    @Override
    public Order createBatchOrder(List<Order> asList) {
        return null;
    }
}
